package com.filetransfer.filesTCP.dao;

import com.filetransfer.filesTCP.util.getJdbcTemple;
import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * Description: these message can be deleted
 * Author:sold out
 * Create Date: 2021/12/20 23:54
 * Version: JDK 1.8
 */
@Repository
public class checkLoginDao {
    String sql = "select password from user where username = ?";

    public String checkLogin(String username) {
        JdbcTemplate jdbcTemplate = getJdbcTemple.getJdbcTemplate();
        return jdbcTemplate.queryForObject(sql, new BeanPropertyRowMapper<String>(String.class), username);
    }
}
